'''
Created on Nov 6, 2009

@author: sax
'''

from xadmin.helpers import ACTION_CHECKBOX_NAME
from xadmin.options import XModelAdmin, HORIZONTAL, VERTICAL
from xadmin.options import StackedInline, TabularInline, InlineModelAdmin, BaseModelAdmin
from xadmin.sites import XAdminSite, site
from django.utils.importlib import import_module
from xadmin.options import XModelAdmin
ModelAdmin = XModelAdmin

from xadmin.autodiscover import autodiscover
from django.contrib import admin as _admin

class WrapModule(type):
    def __init__(cls, name, bases, dict):
        super(WrapModule, cls).__init__(name, bases, dict)
        setattr(cls, 'StackedInline', StackedInline)
        setattr(cls, 'TabularInline', TabularInline)

_admin.__metaclass__ = WrapModule




_admin.sites.site = site
_admin.site = site
_admin.ModelAdmin = XModelAdmin
_admin.TabularInline = TabularInline
_admin.StackedInline = StackedInline
_admin.InlineModelAdmin = InlineModelAdmin
_admin.options.BaseModelAdmin = BaseModelAdmin

attrs = ('ACTION_CHECKBOX_NAME','AdminSite','HORIZONTAL','LOADING','ModelAdmin','StackedInline','TabularInline',
         'VERTICAL','actions','autodiscover','filterspecs','helpers','models','options','site',
         'sites','util','widgets')



#
#for attr in attrs:
#    setattr(_admin, attr, )


__all__ = ['autodiscover', 'site', 'ModelAdmin', 'XModelAdmin']